/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * 
 * If you have edited the file, please update
 * all the last-modified fields manually. Thanks!
 *
 * @last-modified by: 
 * @last-modified date: 
 * @last-modified time: 
 *
 * @author Swee Zhi
 * @date-created Oct 26, 2011    @time-created 11:03:22 AM
 *
 * @project: 
 * @module: 
 * @institution: 
 *
 */
package util.enumhelper;

import util.enumeration.Language;
import util.enumeration.SingaporeArea;

public class LocalizedSingaporeArea {
    // alphabetical order
    public static String getLocalizedSingaporeAreaAsString(SingaporeArea singaporeArea, String locale) {
        String localizedSingaporeArea = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_US))) {
            localizedSingaporeArea = getSingaporeArea_EN_US(singaporeArea);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_SINGAPORE))) {
            localizedSingaporeArea = getSingaporeArea_EN_SG(singaporeArea);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.MALAY))) {
            localizedSingaporeArea = getSingaporeArea_MS_MY(singaporeArea);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.CHINESE_CHINA))) {
            localizedSingaporeArea = getSingaporeArea_ZH_CN(singaporeArea);
        }
        // other language...
        else {
            localizedSingaporeArea = getSingaporeArea_EN_US(singaporeArea);
        }
        
        return localizedSingaporeArea;
    }
    
    // simplified chinese (zh_CN)
    private static String getSingaporeArea_ZH_CN(SingaporeArea singaporeArea) {
        String localizedSingaporeArea = "";
        
        switch (singaporeArea) {
            case CENTRAL: localizedSingaporeArea = "中环" ; break;
            case NORTH: localizedSingaporeArea = "北部"; break;
            case NORTHEAST: localizedSingaporeArea = "东北部" ; break;
            case NORTHWEST: localizedSingaporeArea = "西北部"; break;
            case SOUTH: localizedSingaporeArea = "南部" ; break;
            case SOUTHEAST: localizedSingaporeArea = "东南部"; break;
            case SOUTHWEST: localizedSingaporeArea = "西南部"; break;
            case EAST: localizedSingaporeArea = "东部"; break;
            case WEST: localizedSingaporeArea = "西部"; break;
        }
        return localizedSingaporeArea;
    }
    
    // default (en_US)
    private static String getSingaporeArea_EN_US(SingaporeArea singaporeArea) {
        String localizedSingaporeArea = "";
        
        switch (singaporeArea) {
            case CENTRAL: localizedSingaporeArea = "Central" ; break;
            case NORTH: localizedSingaporeArea = "North"; break;
            case NORTHEAST: localizedSingaporeArea = "North East" ; break;
            case NORTHWEST: localizedSingaporeArea = "North West"; break;
            case SOUTH: localizedSingaporeArea = "South" ; break;
            case SOUTHEAST: localizedSingaporeArea = "South East"; break;
            case SOUTHWEST: localizedSingaporeArea = "South West"; break;
            case EAST: localizedSingaporeArea = "East"; break;
            case WEST: localizedSingaporeArea = "West"; break;
        }
        return localizedSingaporeArea;
    }
    
    // singapore english (en_SG)
    private static String getSingaporeArea_EN_SG(SingaporeArea singaporeArea) {
        String localizedSingaporeArea = "";
        
        switch (singaporeArea) {
            case CENTRAL: localizedSingaporeArea = "Central" ; break;
            case NORTH: localizedSingaporeArea = "North"; break;
            case NORTHEAST: localizedSingaporeArea = "North East" ; break;
            case NORTHWEST: localizedSingaporeArea = "North West"; break;
            case SOUTH: localizedSingaporeArea = "South" ; break;
            case SOUTHEAST: localizedSingaporeArea = "South East"; break;
            case SOUTHWEST: localizedSingaporeArea = "South West"; break;
            case EAST: localizedSingaporeArea = "East"; break;
            case WEST: localizedSingaporeArea = "West"; break;
        }
        return localizedSingaporeArea;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getSingaporeArea_MS_MY(SingaporeArea singaporeArea) {
        String localizedSingaporeArea = "";
        
        switch (singaporeArea) {
            case CENTRAL: localizedSingaporeArea = "Tengah" ; break;
            case NORTH: localizedSingaporeArea = "Utara"; break;
            case NORTHEAST: localizedSingaporeArea = "Utara Timur" ; break;
            case NORTHWEST: localizedSingaporeArea = "Utara Barat"; break;
            case SOUTH: localizedSingaporeArea = "Selatan" ; break;
            case SOUTHEAST: localizedSingaporeArea = "Tenggara"; break;
            case SOUTHWEST: localizedSingaporeArea = "Barat Daya"; break;
            case EAST: localizedSingaporeArea = "Timur"; break;
            case WEST: localizedSingaporeArea = "Barat"; break;
        }
        return localizedSingaporeArea;
    }
}
